package com.kongwg.exer1;

import org.junit.Test;

/**
 * @author kongwg
 * @create 2020-12-17 16:38
 */
public class DAOTest {
    //创建 DAO 类的对象， 分别调用其 save、get、update、list、delete 方法来操作 User 对象，
    @Test
    public void test(){
        DAOUser user = new DAOUser();
        user.save("1",new User(1001,18,"kong"));
        user.save("2",new User(1002,10,"zheng"));
        user.save("3",new User(1003,19,"wang"));

        System.out.println("**********");
        System.out.println(user.list());
        System.out.println("**********");

        User get1 = user.get("2");
        System.out.println(get1);
        System.out.println("**********");
        user.update("1",new User(1000,17,"zhuo"));
        System.out.println("**********");
        System.out.println(user.list());
        System.out.println("**********");
        user.delete("3");
        System.out.println(user.list());


    }
}
